﻿using Shop.RemoteModel.CouponGoods;
using Shop.RemoteModel.CouponGoods.Model;
using Shop.Service.Interface;
using WeDonekRpc.Client.Interface;

namespace Shop.Service.RpcEvent
{
    internal class CouponGoodsEvent : IRpcApiService
    {
        private readonly ICouponGoodsService _Service;

        public CouponGoodsEvent (ICouponGoodsService service)
        {
            this._Service = service;
        }
        public CouponSkuDatum[] SetCouponGoods (SetCouponGoods obj)
        {
            return this._Service.Adds(obj.CouponId, obj.List);
        }
        public void DeleteCouponGoods (DeleteCouponGoods obj)
        {
            this._Service.Delete(obj.Id);
        }

        public void BatchDeleteCouponGoods (BatchDeleteCouponGoods obj)
        {
            this._Service.Delete(obj.CouponId, obj.Ids);
        }

        public CouponSkuDatum[] GetCouponGoods (GetCouponGoods obj)
        {
            return this._Service.GetSkus(obj.CouponId);
        }
    }
}
